package com.nbsaas.boot.project.rest.convert;

import com.nbsaas.boot.project.data.entity.ProjectApp;
import com.nbsaas.boot.project.api.domain.simple.ProjectAppSimple;

import com.nbsaas.boot.rest.api.Converter;

/**
* 列表对象转换器
*/

public class ProjectAppSimpleConvert implements Converter<ProjectAppSimple, ProjectApp> {




@Override
public ProjectAppSimple convert(ProjectApp source) {
    ProjectAppSimple result = new ProjectAppSimple();

                result.setNote(source.getNote());
                result.setName(source.getName());
                if(source.getProject()!=null){
                    result.setProject(source.getProject().getId());
                }
                result.setId(source.getId());
                if(source.getProject()!=null){
                    result.setProjectName(source.getProject().getName());
                }
                result.setAddDate(source.getAddDate());
                result.setLastDate(source.getLastDate());


    return result;
}

}